package com.nofx.mydemo.controller;

import com.nofx.mydemo.common.constant.log.OpType;
import com.nofx.mydemo.common.log.annotation.DebugLog;
import com.nofx.mydemo.vo.OrderVo;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * @author yanyuchi
 * @date 2021-03-20 22:31
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @GetMapping("/detail/{id}")
    @DebugLog(opType = OpType.QUERY,opItem = "order",opItemIdExpression = "#id")
    public String  detail(@PathVariable String id){

        return id;

    }

    @PostMapping("/add")
    @DebugLog(opType = OpType.ADD,opItem = "order",opItemIdExpression = "#orderVo.id")
    public String insert(@RequestBody OrderVo orderVo){

        System.out.println(orderVo.toString());

        return orderVo.toString();
    }
}
